---
title: "Callbacks"
description: "Learn how to use callbacks to respond to c15t events in your application."
lastModified: 2025-08-20
availableIn:
  - framework: 'javascript'
    url: '/docs/frameworks/javascript/callbacks'
    title: 'JavaScript'
  - framework: 'next'
    url: '/docs/frameworks/next/callbacks'
    title: 'Next.js'
  - framework: 'react'
    url: '/docs/frameworks/react/callbacks'
    title: 'React'
---

## Implementing Callbacks

```tsx
import { configureConsentManager, type ConsentManagerOptions } from 'c15t';

export const c15tConfig: ConsentManagerOptions = {
  mode: 'c15t',
  backendURL: "https://your-instance.c15t.dev",
  callbacks: {
    onBannerFetched(response) {
      console.log('Consent banner fetched', response);
    },
    onConsentSet(response) {
      console.log('Consent has been saved', response);
    },
    onError(error) {
      console.log('Error', error);
    },
  }
};

const c15t = configureConsentManager(c15tConfig);
```

<import>./shared/available-callbacks.mdx</import>
